package com.zzc.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author Zzc
 * @since 2020-08-05
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode()
@Document(indexName = "product")
public class Product implements Serializable {

    private static final long serialVersionUID=1L;

    @Id
    @Field(type = FieldType.Integer,store = true)
    @TableId(value = "product_id", type = IdType.AUTO)
    private Integer productId;

    @Field(type = FieldType.Text, store = true, analyzer = "ik_max_word")
    private String productName;

    @Field(type = FieldType.Text, store = true)
    private String normalPrice;

    @Field(type = FieldType.Text, store = true)
    private String miaoshaPrice;

    @Field(type = FieldType.Integer)
    private Integer productInventory;

    @Field(type = FieldType.Text, store = true, analyzer = "ik_max_word")
    private String productDescription;

    @Field(type = FieldType.Text, store = true, analyzer = "ik_max_word")
    private String productImage;


}
